<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/mandarava/dataCh.hpp 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_167799c5d54b642df145e58207d8d1d2.html">mandarava</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">dataCh.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../de/dfb/data_ch_8hpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span> </div>
<div class="foldopen" id="foldopen00011" data-start="{" data-end="};">
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112">   11</a></span><span class="keyword">enum class</span> <a class="code hl_enumeration" href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112">chType</a></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span>{</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span>    <a class="code hl_enumvalue" href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112a7b804a28d6154ab8007287532037f1d0">SERIAL</a>,</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span>    <a class="code hl_enumvalue" href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112a2f2ace6fd759049fe2370b3e2a0f5901">TCP_SVR</a>,</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span>    <a class="code hl_enumvalue" href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112af5ef036b4d8b630721e51fe23489fbc9">UDP</a>,</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span>    <a class="code hl_enumvalue" href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112aba8965f1c7f44af373d42faab853e94f">TCP_CONNECTION</a>,</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span>    <a class="code hl_enumvalue" href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112a9fc5887c030f7a3e19821ebec457e719">FILE</a>,</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span>    <a class="code hl_enumvalue" href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112a6d5050f7a97e7e2e881a4e09dfbd6087">CAN</a>,</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span>    <a class="code hl_enumvalue" href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112aae804beca913e84e57f2288debee6d2a">BLE</a>,</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span>    <a class="code hl_enumvalue" href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112ab698253c4ccfe250cddab9a1367dfad0">RAW_SOCKET</a>,</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span>    <a class="code hl_enumvalue" href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112aa4b03abff0e37da035d6fc0f9a4b1235">GPIO</a></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>};</div>
</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#if defined( WIN32 ) || defined( WINNT )</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="keyword">using </span>nativeH_t = HANDLE;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="preprocessor">#elif defined( __LINUX__ )</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="keyword">using </span>nativeH_t = int;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span> </div>
<div class="foldopen" id="foldopen00030" data-start="{" data-end="};">
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="../../db/d78/structdata_ch.html">   30</a></span><span class="keyword">struct </span><a class="code hl_struct" href="../../db/d78/structdata_ch.html">dataCh</a></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span>{</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="../../db/d78/structdata_ch.html#a10a58a51fe8cd1be6341144a5e9af598">   32</a></span>    <a class="code hl_enumeration" href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112">chType</a>    <a class="code hl_variable" href="../../db/d78/structdata_ch.html#a10a58a51fe8cd1be6341144a5e9af598">m_type</a>;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="../../db/d78/structdata_ch.html#aec26b87a6293709885e7ce6b4348cc69">   36</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../db/d78/structdata_ch.html#aec26b87a6293709885e7ce6b4348cc69">onReadyRead</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * data = <span class="keyword">nullptr</span> , <span class="keywordtype">size_t</span> len )  = 0;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="../../db/d78/structdata_ch.html#ac58c0dde99cef17a9d095d066479897c">   37</a></span>    <span class="keyword">virtual</span> nativeH_t <a class="code hl_function" href="../../db/d78/structdata_ch.html#ac58c0dde99cef17a9d095d066479897c">native_handle</a>() = 0;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>};</div>
</div>
<div class="ttc" id="adata_ch_8hpp_html_a26fac20c91f664a1fc2936bfddc87112"><div class="ttname"><a href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112">chType</a></div><div class="ttdeci">chType</div><div class="ttdoc">数据通道定义。使用这个定义的数据通道可以使用epoll模块进行操作</div><div class="ttdef"><b>定义</b> <a href="#l00011">dataCh.hpp:12</a></div></div>
<div class="ttc" id="adata_ch_8hpp_html_a26fac20c91f664a1fc2936bfddc87112a2f2ace6fd759049fe2370b3e2a0f5901"><div class="ttname"><a href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112a2f2ace6fd759049fe2370b3e2a0f5901">chType::TCP_SVR</a></div><div class="ttdeci">@ TCP_SVR</div></div>
<div class="ttc" id="adata_ch_8hpp_html_a26fac20c91f664a1fc2936bfddc87112a6d5050f7a97e7e2e881a4e09dfbd6087"><div class="ttname"><a href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112a6d5050f7a97e7e2e881a4e09dfbd6087">chType::CAN</a></div><div class="ttdeci">@ CAN</div></div>
<div class="ttc" id="adata_ch_8hpp_html_a26fac20c91f664a1fc2936bfddc87112a7b804a28d6154ab8007287532037f1d0"><div class="ttname"><a href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112a7b804a28d6154ab8007287532037f1d0">chType::SERIAL</a></div><div class="ttdeci">@ SERIAL</div></div>
<div class="ttc" id="adata_ch_8hpp_html_a26fac20c91f664a1fc2936bfddc87112a9fc5887c030f7a3e19821ebec457e719"><div class="ttname"><a href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112a9fc5887c030f7a3e19821ebec457e719">chType::FILE</a></div><div class="ttdeci">@ FILE</div></div>
<div class="ttc" id="adata_ch_8hpp_html_a26fac20c91f664a1fc2936bfddc87112aa4b03abff0e37da035d6fc0f9a4b1235"><div class="ttname"><a href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112aa4b03abff0e37da035d6fc0f9a4b1235">chType::GPIO</a></div><div class="ttdeci">@ GPIO</div></div>
<div class="ttc" id="adata_ch_8hpp_html_a26fac20c91f664a1fc2936bfddc87112aae804beca913e84e57f2288debee6d2a"><div class="ttname"><a href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112aae804beca913e84e57f2288debee6d2a">chType::BLE</a></div><div class="ttdeci">@ BLE</div></div>
<div class="ttc" id="adata_ch_8hpp_html_a26fac20c91f664a1fc2936bfddc87112ab698253c4ccfe250cddab9a1367dfad0"><div class="ttname"><a href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112ab698253c4ccfe250cddab9a1367dfad0">chType::RAW_SOCKET</a></div><div class="ttdeci">@ RAW_SOCKET</div></div>
<div class="ttc" id="adata_ch_8hpp_html_a26fac20c91f664a1fc2936bfddc87112aba8965f1c7f44af373d42faab853e94f"><div class="ttname"><a href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112aba8965f1c7f44af373d42faab853e94f">chType::TCP_CONNECTION</a></div><div class="ttdeci">@ TCP_CONNECTION</div></div>
<div class="ttc" id="adata_ch_8hpp_html_a26fac20c91f664a1fc2936bfddc87112af5ef036b4d8b630721e51fe23489fbc9"><div class="ttname"><a href="../../de/dfb/data_ch_8hpp.html#a26fac20c91f664a1fc2936bfddc87112af5ef036b4d8b630721e51fe23489fbc9">chType::UDP</a></div><div class="ttdeci">@ UDP</div></div>
<div class="ttc" id="astructdata_ch_html"><div class="ttname"><a href="../../db/d78/structdata_ch.html">dataCh</a></div><div class="ttdef"><b>定义</b> <a href="#l00030">dataCh.hpp:31</a></div></div>
<div class="ttc" id="astructdata_ch_html_a10a58a51fe8cd1be6341144a5e9af598"><div class="ttname"><a href="../../db/d78/structdata_ch.html#a10a58a51fe8cd1be6341144a5e9af598">dataCh::m_type</a></div><div class="ttdeci">chType m_type</div><div class="ttdef"><b>定义</b> <a href="#l00032">dataCh.hpp:32</a></div></div>
<div class="ttc" id="astructdata_ch_html_ac58c0dde99cef17a9d095d066479897c"><div class="ttname"><a href="../../db/d78/structdata_ch.html#ac58c0dde99cef17a9d095d066479897c">dataCh::native_handle</a></div><div class="ttdeci">virtual nativeH_t native_handle()=0</div></div>
<div class="ttc" id="astructdata_ch_html_aec26b87a6293709885e7ce6b4348cc69"><div class="ttname"><a href="../../db/d78/structdata_ch.html#aec26b87a6293709885e7ce6b4348cc69">dataCh::onReadyRead</a></div><div class="ttdeci">virtual void onReadyRead(const char *data=nullptr, size_t len)=0</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
